package com.maelarak.android.lolcharbuilder.models;

import com.maelarak.android.lolcharbuilder.config.GameProperties;

import java.util.ArrayList;

/**
 * LolCharBuilder
 * Created by MaelArak on 09/06/13.
 */
public class Build {
    private static final String CLASSTAG = "Build.java";
    private Champion character;
    private ArrayList<Item> itemlist;
    private ArrayList<Skill> skilllist;
    private StringBuffer buildname;
    private boolean isLastUsed;

    public Build(){
        super();
        character = null;
        buildname = new StringBuffer(128);
        itemlist = new ArrayList<Item>(GameProperties.MAX_ITEM_NUMBER);
        skilllist = new ArrayList<Skill>(GameProperties.MAX_SKILL_NUMBER);
        isLastUsed = false;
    }

    public Build(Champion character, ArrayList<Item> itemlist, ArrayList<Skill> skilllist, StringBuffer buildname, boolean lastUsed) {
        this.character = character;
        this.itemlist = itemlist;
        this.skilllist = skilllist;
        this.buildname = buildname;
        isLastUsed = lastUsed;
    }

    public Champion getCharacter() {
        return character;
    }

    public void setCharacter(Champion character) {
        this.character = character;
    }

    public ArrayList<Item> getItemlist() {
        return itemlist;
    }

    public void setItemlist(ArrayList<Item> itemlist) {
        this.itemlist = itemlist;
    }

    public ArrayList<Skill> getSkilllist() {
        return skilllist;
    }

    public void setSkilllist(ArrayList<Skill> skilllist) {
        this.skilllist = skilllist;
    }

    public StringBuffer getBuildname() {
        return buildname;
    }

    public void setBuildname(StringBuffer buildname) {
        this.buildname = buildname;
    }

    public boolean isLastUsed() {
        return isLastUsed;
    }

    public void setLastUsed(boolean lastUsed) {
        isLastUsed = lastUsed;
    }

    //TODO Gérer le else
    public void addSkill(Skill s){
        if (skilllist.size()<GameProperties.MAX_SKILL_NUMBER){
            this.skilllist.add(s);
        } else {

        }
    }

    //TODO Gérer le else
    public void addItem(Item i){
        if (itemlist.size()<GameProperties.MAX_ITEM_NUMBER){
            itemlist.add(i);
        } else {

        }
    }

}
